import config from '../../utils/config';
import apiCreator from '../../utils/apiCreator';

const api = apiCreator();

export default {
  //获取关联规则
  getRulesData: (query) => api.get(`${config.interfaces.type5}risk-server/riskCtrl/deputyRule`, query),
  //创建限额规则
  createRule: (query) => api.post(`${config.interfaces.type5}risk-server/riskCtrl/createRule`, query),
  //修改限额规则
  modifyRule: (query) => api.post(`${config.interfaces.type5}risk-server/riskCtrl/modifyRule`, query),
  //删除限额规则
  deleteRule: (query) => api.post(`${config.interfaces.type5}risk-server/riskCtrl/deleteRule`, query),
  //查询限额列表
  queryRules: (query) => api.post(`${config.interfaces.type5}risk-server/riskCtrl/queryRules`, query),
  //证券范围下拉
  queryConditionByIndexClass: (query) => api.get(`${config.interfaces.type5}risk-server/riskCtrl/queryConditionByIndexClass`, query),
  //计算因子 下拉
  queryFactorByIndexClass: (query) => api.get(`${config.interfaces.type5}risk-server/riskCtrl/queryFactorByIndexClass`, query),
  //查询产品
  queryRootNodeAll: (query) => api.get(`${config.interfaces.type5}portfolio-server/portfolioInfo/queryRootNodeAll`, query),
  //查询组合
  getTreeAll: (query) => api.get(`${config.interfaces.type5}portfolio-server/portfolioInfo/getTreeAll`, query),
  //新增分子的模板
  addTemplate: (query) => api.post(`${config.interfaces.type5}risk-server/riskCtrl/addIndex`, query),
  //编辑分子的模板
  editTemplate: (query) => api.post(`${config.interfaces.type5}risk-server/riskCtrl/editDemo`, query),
  //查询分子的模板列表
  queryTemplateList: (query) => api.get(`${config.interfaces.type5}risk-server/riskCtrl/findByTenant`, query),
  //删除分子的模板
  deleteTemplate: (query) => api.get(`${config.interfaces.type5}risk-server/riskCtrl/deleteDemo`, query),
};
